<?php

namespace App\Models;


class Shop extends Orm
{
    //
    protected $table = 'shop';
    protected $dateFormat = 'U';
    public $timestamps = true;


    public function setLogoAttribute($value)
    {
        $this->dealSetImageAttribute('logo', $value);
    }

    public function userInfo()
    {
        return $this->belongsTo(Users::class, 'user_id');
    }

    public function goods()
    {
        return $this->hasMany(Goods::class, 'shop_id');
    }

    public function orders()
    {
        return $this->hasMany(GoodsOrder::class,'shop_id');
    }

}
